import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'

let instance = axios.create();
instance.defaults.baseURL = '/api'
instance.interceptors.request.use(config => {
  config.url = config.url + '?apikey=0df993c66c0c636e29ecbb5344252a4a&start=0&count=10'
  return config
})

Vue.prototype.$http = instance



Vue.prototype.axios = axios;
axios.defaults.baseURL = '/api';

Vue.filter('setWH', (url, arg) => {
  return url.replace(/w\.h/, arg);
});

// 注册全局组件
import Scroller from '@/components/Scroller';
Vue.component('Scroller', Scroller);




// Loading全局组件和方法：
import Loading from '@/components/Loading'
Vue.component('Loading', Loading)

import LoadingMix from "@/util/mixin_fn.js";
Vue.mixin(LoadingMix)

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')